#include <iostream>
#include <vector>
#include <string>

using namespace std;

int getPowFive(int n){
    int i = 0;
    while(n != 0 &&n%5 == 0){
        n /= 5;
        i++;
    }
    return i;
}

int myTrailingZeroes(int n) {
    int i = 1, r = 0;
    while(i*5 <= n){
        r += 1 + getPowFive(i);
        i++;
    }
    return r;
}

int trailingZeroes(int n) {
    int ans = 0;
    while (n) {
        n /= 5;
        ans += n;
    }
    return ans;
}

int main(){
    int n = 30;
    cout << trailingZeroes(n) << endl;
    return 0;
}
